package Thread;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.util.concurrent.TimeUnit;

/***
 *
 */
public class IsStopThread {

    private  static boolean isTrue =true;

    public static void main(String[] args) {
       new Thread(new Runnable() {
                @Override
                public void run() {
                    int  i=0;

                    while(IsStopThread.isTrue){
                        i++;
                    }
                    System.out.println(i);
                }
            }).start();
       try{
           TimeUnit.SECONDS.sleep(2);
       } catch (InterruptedException e) {
           e.printStackTrace();
       }
       isTrue =false;
        System.out.println("被指为false了");
    }
}
